<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8"/>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>avalonjs_test</title>
  <style>
  #sortable { list-style-type: none; margin: 0; padding: 0; }
  #sortable li {
      color: #FFFFFF;
      text-align: center;
      font-size: 20px;
      background: #666666;
      padding: 4px;
      height: 90px;
      width: 90px;
      margin: 3px;
      position: relative;
      float: left;
  }
  </style>
</head>
<body>
  <ul ms-controller="data_box" id="sortable">
  <li ms-repeat="datas">{{el}}
  <div><button ms-click="del(el);">删除</button></div>
  </li>
  </ul>
  <script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.8.3/jquery.min.js"></script>
  <script type="text/javascript" src="http://lib.sinaapp.com/js/jquery-ui/1.10.2/jquery-ui.min.js"></script>
  <script type="text/javascript" src="avalon.min.js"></script>
  <script>
  $(function(){
    $('#sortable').sortable();
    var data_box = avalon.define("data_box", function(vm){
      vm.datas=['a','b','c','d','e'];
      vm.del = function(e){
        var index = vm.datas.indexOf(e);
        vm.datas.splice(index, 1);
      }
    })
  })
  </script>
</body>
</html>